package com.hopu.blb_erp.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hopu.blb_erp.entity.Menu;
import com.hopu.blb_erp.mapper.MenuMapper;
import com.hopu.blb_erp.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xxl
 * @since 2021-11-22
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {
    @Autowired
    private MenuMapper menuMapper;
    @Override
    public List<Menu> getMenuTree() {
        return menuMapper.getMenuTree();
    }
    @Transactional
    @Override
    public void removeByPidAddId(Integer pid) {
        menuMapper.deleteById(pid);
        menuMapper.deleteByPId(pid);
    }
}
